package core;

/**
 * A single song of any format.
 * 
 * @author Jason
 * 
 */
public class Song {

	private static final String NULL = "";

	private final MusicLibrary owner;
	private String title, artist, album;
	private short year;
	private int startTime, endTime;
	private String genre;
	private int fileSize;
	private String comment;
	private byte track;

	public Song(MusicLibrary owner) {
		this.owner = owner;
		title = NULL;
		artist = NULL;
		album = NULL;
		genre = NULL;
		comment = NULL;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getArtist() {
		return artist;
	}

	public void setArtist(String artist) {
		this.artist = artist;
	}

	public String getAlbum() {
		return album;
	}

	public void setAlbum(String album) {
		this.album = album;
	}

	public short getYear() {
		return year;
	}

	public void setYear(short year) {
		this.year = year;
	}

	public int getStartTime() {
		return startTime;
	}

	public void setStartTime(int startTime) {
		this.startTime = startTime;
	}

	public int getEndTime() {
		return endTime;
	}

	public void setEndTime(int endTime) {
		this.endTime = endTime;
	}

	public int getTotalTime() {
		return endTime - startTime;
	}

	public String getGenre() {
		return genre;
	}

	public void setGenre(String genre) {
		this.genre = genre;
	}

	public void setFileSize(int fileSize) {
		this.fileSize = fileSize;
	}

	public int getFileSize() {
		return fileSize;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getComment() {
		return comment;
	}

	public void setTrack(byte track) {
		this.track = track;
	}

	public int getTrack() {
		return track;
	}

	public MusicLibrary getOwner() {
		return owner;
	}

	@Override
	public int hashCode() {
		return title.hashCode() + artist.hashCode() + album.hashCode() + year
				+ startTime + endTime + genre.hashCode() + fileSize
				+ comment.hashCode() + track;
	}
}
